<?php
/*************************************************************************************
   Copyright notice
   
   (c) 2002-2007 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
 
   This script is part of PHPWCMS. The PHPWCMS web content management system is
   free software; you can redistribute it and/or modify it under the terms of
   the GNU General Public License as published by the Free Software Foundation;
   either version 2 of the License, or (at your option) any later version.
  
   The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
   A copy is found in the textfile GPL.txt and important notices to the license 
   from the author is found in LICENSE.txt distributed with these scripts.
  
   This script is distributed in the hope that it will be useful, but WITHOUT ANY 
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
   This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************

   Google Maps Module by breitsch (mail@casa-loca.com)

*************************************************************************************/

// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
   die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------

// pack abbreviation/language array
	$a_languages = array(
	'af' => 'Afrikaans',
	'sq' => 'Albanian',
	'ar-dz' => 'Arabic (Algeria)',
	'ar-bh' => 'Arabic (Bahrain)',
	'ar-eg' => 'Arabic (Egypt)',
	'ar-iq' => 'Arabic (Iraq)',
	'ar-jo' => 'Arabic (Jordan)',
	'ar-kw' => 'Arabic (Kuwait)',
	'ar-lb' => 'Arabic (Lebanon)',
	'ar-ly' => 'Arabic (libya)',
	'ar-ma' => 'Arabic (Morocco)',
	'ar-om' => 'Arabic (Oman)',
	'ar-qa' => 'Arabic (Qatar)',
	'ar-sa' => 'Arabic (Saudi Arabia)',
	'ar-sy' => 'Arabic (Syria)',
	'ar-tn' => 'Arabic (Tunisia)',
	'ar-ae' => 'Arabic (U.A.E.)',
	'ar-ye' => 'Arabic (Yemen)',
	'ar' => 'Arabic',
	'hy' => 'Armenian',
	'as' => 'Assamese',
	'az' => 'Azeri',
	'eu' => 'Basque',
	'be' => 'Belarusian',
	'bn' => 'Bengali',
	'bg' => 'Bulgarian',
	'ca' => 'Catalan',
	'zh-cn' => 'Chinese (China)',
	'zh-hk' => 'Chinese (Hong Kong SAR)',
	'zh-mo' => 'Chinese (Macau SAR)',
	'zh-sg' => 'Chinese (Singapore)',
	'zh-tw' => 'Chinese (Taiwan)',
	'zh' => 'Chinese',
	'hr' => 'Croatian',
	'cs' => 'Czech',
	'da' => 'Danish',
	'div' => 'Divehi',
	'nl-be' => 'Dutch (Belgium)',
	'nl' => 'Dutch (Netherlands)',
	'en-au' => 'English (Australia)',
	'en-bz' => 'English (Belize)',
	'en-ca' => 'English (Canada)',
	'en-ie' => 'English (Ireland)',
	'en-jm' => 'English (Jamaica)',
	'en-nz' => 'English (New Zealand)',
	'en-ph' => 'English (Philippines)',
	'en-za' => 'English (South Africa)',
	'en-tt' => 'English (Trinidad)',
	'en-gb' => 'English (United Kingdom)',
	'en-us' => 'English (United States)',
	'en-zw' => 'English (Zimbabwe)',
	'en' => 'English',
	'us' => 'English (United States)',
	'et' => 'Estonian',
	'fo' => 'Faeroese',
	'fa' => 'Farsi',
	'fi' => 'Finnish',
	'fr-be' => 'French (Belgium)',
	'fr-ca' => 'French (Canada)',
	'fr-lu' => 'French (Luxembourg)',
	'fr-mc' => 'French (Monaco)',
	'fr-ch' => 'French (Switzerland)',
	'fr' => 'French (France)',
	'mk' => 'FYRO Macedonian',
	'gd' => 'Gaelic',
	'ka' => 'Georgian',
	'de-at' => 'German (Austria)',
	'de-li' => 'German (Liechtenstein)',
	'de-lu' => 'German (Luxembourg)',
	'de-ch' => 'German (Switzerland)',
	'de' => 'German (Germany)',
	'el' => 'Greek',
	'gu' => 'Gujarati',
	'he' => 'Hebrew',
	'hi' => 'Hindi',
	'hu' => 'Hungarian',
	'is' => 'Icelandic',
	'id' => 'Indonesian',
	'it-ch' => 'Italian (Switzerland)',
	'it' => 'Italian (Italy)',
	'ja' => 'Japanese',
	'kn' => 'Kannada',
	'kk' => 'Kazakh',
	'kok' => 'Konkani',
	'ko' => 'Korean',
	'kz' => 'Kyrgyz',
	'lv' => 'Latvian',
	'lt' => 'Lithuanian',
	'ms' => 'Malay',
	'ml' => 'Malayalam',
	'mt' => 'Maltese',
	'mr' => 'Marathi',
	'mn' => 'Mongolian (Cyrillic)',
	'ne' => 'Nepali (India)',
	'nb-no' => 'Norwegian (Bokmal)',
	'nn-no' => 'Norwegian (Nynorsk)',
	'no' => 'Norwegian (Bokmal)',
	'or' => 'Oriya',
	'pl' => 'Polish',
	'pt-br' => 'Portuguese (Brazil)',
	'pt' => 'Portuguese (Portugal)',
	'pa' => 'Punjabi',
	'rm' => 'Rhaeto-Romanic',
	'ro-md' => 'Romanian (Moldova)',
	'ro' => 'Romanian',
	'ru-md' => 'Russian (Moldova)',
	'ru' => 'Russian',
	'sa' => 'Sanskrit',
	'sr' => 'Serbian',
	'sk' => 'Slovak',
	'ls' => 'Slovenian',
	'sb' => 'Sorbian',
	'es-ar' => 'Spanish (Argentina)',
	'es-bo' => 'Spanish (Bolivia)',
	'es-cl' => 'Spanish (Chile)',
	'es-co' => 'Spanish (Colombia)',
	'es-cr' => 'Spanish (Costa Rica)',
	'es-do' => 'Spanish (Dominican Republic)',
	'es-ec' => 'Spanish (Ecuador)',
	'es-sv' => 'Spanish (El Salvador)',
	'es-gt' => 'Spanish (Guatemala)',
	'es-hn' => 'Spanish (Honduras)',
	'es-mx' => 'Spanish (Mexico)',
	'es-ni' => 'Spanish (Nicaragua)',
	'es-pa' => 'Spanish (Panama)',
	'es-py' => 'Spanish (Paraguay)',
	'es-pe' => 'Spanish (Peru)',
	'es-pr' => 'Spanish (Puerto Rico)',
	'es-us' => 'Spanish (United States)',
	'es-uy' => 'Spanish (Uruguay)',
	'es-ve' => 'Spanish (Venezuela)',
	'es' => 'Spanish (Traditional Sort)',
	'sx' => 'Sutu',
	'sw' => 'Swahili',
	'sv-fi' => 'Swedish (Finland)',
	'sv' => 'Swedish',
	'syr' => 'Syriac',
	'ta' => 'Tamil',
	'tt' => 'Tatar',
	'te' => 'Telugu',
	'th' => 'Thai',
	'ts' => 'Tsonga',
	'tn' => 'Tswana',
	'tr' => 'Turkish',
	'uk' => 'Ukrainian',
	'ur' => 'Urdu',
	'uz' => 'Uzbek',
	'vi' => 'Vietnamese',
	'xh' => 'Xhosa',
	'yi' => 'Yiddish',
	'zu' => 'Zulu' );

?>

<form action="<?php echo map_url( array('controller=lang', 'edit='.$plugin['data']['gm_lang_id']) ) ?>" name="frmLang" method="post" style="background:#F3F5F8;border-top:1px solid #92A1AF;border-bottom:1px solid #92A1AF;margin:0 0 5px 0;padding:10px 8px 15px 8px">
<input type="hidden" name="grrr" value="<?php echo $plugin['data']['gm_lang_id'] ?>" />
<table border="0" cellpadding="0" cellspacing="0" width="100%" summary="">
	<tr> 
		<td align="right" class="chatlist"><?php echo $BL['be_cnt_last_edited']  ?>:&nbsp;</td>
		<td colspan="2" class="v10" width="410"><?php 
		
		echo html_specialchars(date($BL['be_fprivedit_dateformat'], $plugin['data']['gm_lang_changedate'])) ;
		
		if(!empty($plugin['data']['gm_lang_createdate'])) {
		?>		
		&nbsp;&nbsp;&nbsp;<span class="chatlist"><?php echo $BL['be_fprivedit_created']  ?>:</span> 
		<?php 
				echo html_specialchars(date($BL['be_fprivedit_dateformat'], strtotime($plugin['data']['gm_lang_createdate'])));
		}
		
		?></td>
	</tr>

	<tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>

<?php if ($plugin['data']['gm_lang_id'] == 0)  { ?>
	<tr> 
		<td align="right" class="chatlist"><?php echo $BLM['lang_name'] ?>:&nbsp;</td>
		<td colspan="2">
    <select name="gm_llocs" class="v12<?php
		//error class
		if(!empty($plugin['error']['gm_lang_loc'])) echo ' errorInputText';
		?>" onchange="this.form.submit();">
      <option value="0"> </option>
	<?php
	
		foreach($a_languages as $key => $value) {
			echo '<option value="' . $key . '"';
			if($plugin['data']['gm_lang_loc'] === $key) {
        echo " selected=selected";
        $langName = $value;
      }
			echo '>' . html_specialchars($value) . '</option>' . LF;
		
		}
 		?>   
    </select><?php if(!empty($plugin['error']['gm_lang_loc'])) echo ' '.$plugin['error']['gm_lang_loc']; ?>
    <input type="hidden" name="gm_lang_name" value="<?php echo $langName ?>" />
    </td>
	</tr>
		
<?php } else { ?>
<tr> 
		<td align="right" class="chatlist"><?php echo $BLM['lang_name'] ?>:&nbsp;</td>
		<td colspan="2"><input type="hidden" name="gm_lang_name" value="<?php echo $plugin['data']['gm_lang_name'] ?>" /><strong><?php echo $plugin['data']['gm_lang_name'] ?></strong></td>
</tr>

<?php } ?>
	<tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
  <tr><td colspan="3" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  <tr><td><b>Info Window</b></td><td></td><td rowspan="7"><img src="<?php echo $phpwcms['modules'][$module]['dir'] ?>img/lang_infowindow.gif" alt="" width="204" height="87" /></td></tr>

  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_rpl'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_rpl" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_rpl'])) echo $plugin['data']['lang']['gm_lang_rpl'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_toh'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_toh" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_toh'])) echo $plugin['data']['lang']['gm_lang_toh'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_frh'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_frh" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_frh'])) echo $plugin['data']['lang']['gm_lang_frh'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_sad'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_sad" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_sad'])) echo $plugin['data']['lang']['gm_lang_sad'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_ead'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_ead" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_ead'])) echo $plugin['data']['lang']['gm_lang_ead'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_gdr'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_gdr" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_gdr'])) echo $plugin['data']['lang']['gm_lang_gdr'] ?>" /></td></tr>
 
	<tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
  <tr><td colspan="3" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  <tr><td><b>Category Tab</b></td><td></td><td rowspan="2" valign="top"><img src="<?php echo $phpwcms['modules'][$module]['dir'] ?>img/lang_catTab.gif" alt="" width="199" height="53" /></td></tr>
  
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_tabc'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_tabc" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_tabc'])) echo $plugin['data']['lang']['gm_lang_tabc'] ?>" /></td></tr>

	<tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
  <tr><td colspan="3" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  <tr><td><b>Directions Tab</b></td><td></td><td rowspan="4" valign="top"><img src="<?php echo $phpwcms['modules'][$module]['dir'] ?>img/lang_dirTab.gif" alt="" width="199" height="53" /></td></tr>

  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_tabr'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_tabr" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_tabr'])) echo $plugin['data']['lang']['gm_lang_tabr'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_tabTxt'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_tdtx" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_tdtx'])) echo $plugin['data']['lang']['gm_lang_tdtx'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_tabList'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_tdli" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_tdli'])) echo $plugin['data']['lang']['gm_lang_tdli'] ?>" /></td></tr>

	<tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
  <tr><td colspan="3" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  <tr><td><b>Search Tab</b></td><td></td><td rowspan="11" valign="top"><img src="<?php echo $phpwcms['modules'][$module]['dir'] ?>img/lang_searchTab.gif" alt="" width="199" height="143" /></td></tr>
  
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_tabs'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_tabs" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_tabs'])) echo $plugin['data']['lang']['gm_lang_tabs'] ?>" /></td></tr>  
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_tabTxt'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_tstx" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_tstx'])) echo $plugin['data']['lang']['gm_lang_tstx'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_tabList'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_tsli" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_tsli'])) echo $plugin['data']['lang']['gm_lang_tsli'] ?>" /></td></tr>

  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_sea'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_sea" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_sea'])) echo $plugin['data']['lang']['gm_lang_sea'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_adr'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_adr" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_adr'])) echo $plugin['data']['lang']['gm_lang_adr'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_dis'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_dis" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_dis'])) echo $plugin['data']['lang']['gm_lang_dis'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_rad'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_rad" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_rad'])) echo $plugin['data']['lang']['gm_lang_rad'] ?>" /></td></tr> 
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_sys'] ?>:&nbsp;</td><td><input type="radio"<?php if($plugin['data']['gm_lang_sys']==0) echo ' checked="true"'; ?> name="gm_lang_sys" value="0" />miles&nbsp;&nbsp;
    <input type="radio"<?php if($plugin['data']['gm_lang_sys']==1) echo ' checked="true"'; ?> name="gm_lang_sys" value="1" />km</td></tr>
	<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_nor'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_nor" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_nor'])) echo $plugin['data']['lang']['gm_lang_nor'] ?>" /></td></tr>  

 	<tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
  <tr><td colspan="3" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  <tr><td><b>all Tabs</b></td><td></td><td rowspan="3"></td></tr> 
  
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_pri'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_pri" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_pri'])) echo $plugin['data']['lang']['gm_lang_pri'] ?>" /></td></tr>
  <tr><td align="right" class="chatlist"><?php echo $BLM['lang_cle'] ?>:&nbsp;</td><td><input type="text" name="gm_lang_cle" class="v12" style="width:200px;" size="20" maxlength="200" value="<?php if (isset($plugin['data']['lang']['gm_lang_cle'])) echo $plugin['data']['lang']['gm_lang_cle'] ?>" /></td></tr>

	<tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
  <tr><td colspan="3" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>





<?php  if ($plugin['data']['gm_lang_id']!=1) {	?>
	<tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
	<tr>
		<td align="right" class="chatlist"><?php echo $BL['be_ftptakeover_status'] ?>:&nbsp;</td>
		<td colspan="2"><table border="0" cellpadding="0" cellspacing="0" summary="">		
			<tr>
				<td><input type="checkbox" name="gm_lang_status" id="gm_lang_status" value="1"<?php is_checked($plugin['data']['gm_lang_status'], 1) ?> /></td>
				<td><label for="gm_lang_status"><?php echo $BL['be_cnt_activated'] ?></label></td>
			</tr>
		</table></td>
	</tr>
<?php  } else {	?>
	<tr>
		<td align="right" class="chatlist"></td>
    <td colspan="2"><input type="hidden" name="gm_lang_status" value="1" /></td>
	</tr>
<?php  }	?>
	<tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>

	<tr> 
		<td>&nbsp;</td>
		<td colspan="2"><?php 
		  if(empty($plugin['error']['gm_lang_loc'])) {	?>
			<input name="submit2" id="sub1" type="submit" class="button10" value="<?php echo empty($plugin['data']['gm_lang_id']) ? $BL['be_admin_fcat_button2'] : $BL['be_article_cnt_button1'] ?>" />
			<input name="save" id="sub2" type="submit" class="button10" value="<?php echo $BL['be_article_cnt_button3'] ?>" />
			&nbsp;&nbsp;&nbsp;&nbsp;<?php  }	?>
			<input name="close" type="submit" class="button10" value="<?php echo $BL['be_admin_struct_close'] ?>" />
		</td>
	</tr>
</table>

</form>